<?php 
require_once substr(dirname(__FILE__),0,-1).'sub/init.php';
require_once ZEAI.'sub/conn.php';
require_once ZEAI.'cache/config_index.php';
$t = (empty($t))?'us':$t;
if(ifint($fid))$t='news_detail';
switch ($t) {
	case 'us':
		if(!is_mobile()){header("Location: ".HOST."/about/");exit;}
		$tt  = '关于我们';$headertitle = $tt;
		$share_url = HOST.'/m/about.php?t=us';
	break;
	case 'contact':
		if(!is_mobile()){header("Location: ".HOST."/kefu/");exit;}
		$tt  = '联系我们';$headertitle = $tt;
		$share_url = HOST.'/m/about.php?t=contact';
	break;
	case 'news':
		if(!is_mobile()){header("Location: ".HOST."/about/news/");exit;}
		$tt  = '本站公告';$headertitle = $tt;
		$share_url = HOST.'/m/about.php?t=news';
	break;
	case 'news_detail':
		if(!ifint($fid))alert('暂无内容','-1');
		$row = $db->ROW(__TBL_NEWS__,"title,content,addtime,click","flag=1 AND id=".$fid,"name");
		if ($row){
			$title     = trimhtml(dataIO($row['title'],'out'));
			$content   = dataIO($row['content'],'out');
			$addtime   = YmdHis($row['addtime'],'Ymd');
			$click     = $row['click'];
			$db->query("UPDATE ".__TBL_NEWS__." SET click=click+1 WHERE id=".$fid);
		}else{alert('暂无内容','-1');}
		$tt = $title;
		$headertitle = '本站公告';
		$share_url = HOST.'/m/about.php?fid='.$fid;
	break;
	case 'clause':
		if(!is_mobile()){header("Location: ".HOST."/clause/");exit;}
		$tt = '隐私条款';
	break;
}
$shareT = $tt;
if(!empty($_INDEX['indexShareT'])){
	$shareC = dataIO($_INDEX['indexShareC'],'out');
	$shareP = UP.$_INDEX['indexShareP'];
}else{
	$shareC = dataIO($_INDEX['indexContent'],'out');
	$shareP = UP.$_ZEAI['logo'];
}
?>
<!doctype html><html><head><meta charset="utf-8">
<title><?php echo $tt;?> - <?php echo $_ZEAI['siteName'];?></title>
<?php echo HEADMETA; ?>
<meta name="x5-orientation" content="portrait">
<link href="<?php echo RES;?>m/css/m.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<script src="<?php echo RES;?>www_zeai_cn.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<script src="<?php echo RES;?>m/js/m.js?<?php echo $_ZEAI['cache_str'];?>"></script>
<link href="<?php echo HOST;?>/cache/zeaicolor.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<link href="<?php echo RES;?>m/css/article.css?<?php echo $_ZEAI['cache_str'];?>" rel="stylesheet" type="text/css" />
<style>
body{background-color:#fff}
#backtop a,#btmKefuBtn{background-color:<?php echo $_ZEAI['mob_mbcolor'];?>}
.about{padding:0 8%;}
.about .us{margin-top:9rem;text-align:left;line-height:200%;font-size:1.5rem}
.about .us img{width:100%;margin:1rem auto}
.about .news_detail{margin-top:7rem;text-align:left;line-height:200%;font-size:1.5rem}
.about .news_detail h3{font-size:2rem;font-weight:bold}
.about .news_detail h6{line-height:3rem;border-bottom:#f7f7f7 1px solid;margin-bottom:2rem;padding-bottom:2rem;color:#999}
.about .news_detail img{width:100%;margin:1rem auto}
.about .news{margin-top:70px;text-align:left;line-height:200%;font-size:1.5rem;margin-bottom:10rem}
.about .news a{line-height:2rem;border-bottom:#f7f7f7 1px solid;display:block;padding:1.5rem 0}
.about .news a i{color:#1BAFF7}
.about .news a span{color:#aaa;font-size:1.2rem;margin-left:1rem}
.contact{margin-top:8rem}
.contact li{display:block;font-size:1.6rem;line-height:5rem;color:#333;margin:1.5rem auto;text-align:center;text-align:left;box-sizing:border-box}
.contact li i{width:4rem;height:4rem;line-height:4rem;font-size:2rem;border-radius:4rem;background-color:#FEA2C8;color:#fff;text-align:center;margin-right:2.3rem}
.contact li img{vertical-align:middle;margin-left:1rem}
<?php
if ($_ZEAI['m_mb']==2){
	echo '.TRnav_btn i{color:'.$_ZEAI['mob_mbcolor'].'}';
	$mini_class='top_mini4';
}else{
	$mini_class='top_mini4 zeaibg bgcolor';
}
?>
</style>
</head>
<body>
<?php 
$mini_title=$headertitle;
require_once ZEAI.'m/top_mini.php';
?>
<div class="about">
	<?php if ($t == 'us'){?>
        <div class="us"><?php $row = $db->ROW(__TBL_NEWS__,"content","id=2");echo ($row)?dataIO($row[0],'out'):nodatatips('暂无信息');?></div>
    <?php }elseif($t == 'clause'){?>
        <div class="us"><?php $row = $db->ROW(__TBL_NEWS__,"content","id=1");echo ($row)?dataIO($row[0],'out'):nodatatips('暂无信息');?></div>
    <?php }elseif($t == 'news'){?>
        <div class="news">
            <?php
            $rt=$db->query("SELECT id,title,addtime FROM ".__TBL_NEWS__." WHERE flag=1 AND id>2 AND kind=1 ORDER BY px DESC,id DESC");
            $total = $db->num_rows($rt);
            if ($total > 0) {
                for($i=1;$i<=$total;$i++) {
                    $rows2 = $db->fetch_array($rt,'name');
                    if(!$rows2)break;
                    $id   = $rows2['id'];
                    $title  = dataIO($rows2['title'],'out');
                    $addtime   = YmdHis($rows2['addtime'],'Ymd');
                    $echo .= '<a href="'.HOST.'/m/about.php?fid='.$id.'"><i class="ico">&#xe657;</i> '.$title.'<span>'.$addtime.'</span></a>';
                }
                echo $echo;
            }else{echo '<br><br><br><br>'.nodatatips('暂无内容');}?>
            <div class="clear"></div>
        </div>
    <?php }elseif($t == 'news_detail'){?>
        <div class="news_detail">
        	<h3><?php echo $title;?></h3>
            <h6>发布时间：<?php echo $addtime;?>　　<i class="ico">&#xe643;</i> <?php echo $click;?></h6>
            <?php echo $content;?>
        </div>
    <?php }elseif($t == 'contact'){
        $kf_mob   = dataIO($_ZEAI['kf_mob'],'out');
        $kf_tel   = dataIO($_ZEAI['kf_tel'],'out');
        $kf_qq    = dataIO($_ZEAI['kf_qq'],'out');
        $kf_wx    = dataIO($_ZEAI['kf_wx'],'out'); 
        $kf_wxpic = dataIO($_ZEAI['kf_wxpic'],'out'); 
        $kf_address = dataIO($_ZEAI['kf_address'],'out'); 
        $kf_email = dataIO($_ZEAI['kf_email'],'out'); 
        ?>
        <div class="contact">
            <?php if (!empty($kf_tel)){?><li><i class="ico" style="background-color:#ffba57">&#xe68b;</i> 电话：<a href="tel:<?php echo $kf_tel;?>"><?php echo $kf_tel;?></a></li><?php }?>
            <?php if (!empty($kf_mob)){?><li><i class="ico" style="margin-top:10px;font-size:26px;background-color:#7AD3E9">&#xe627;</i> <span style="margin-top:7px;display:inline-block;vertical-align:top">手机：<a href="tel:<?php echo $kf_mob;?>"><?php echo $kf_mob;?></a></span></li><?php }?>
            <?php if (!empty($kf_wx)){?><li><i class="ico" style="background-color:#31C93C">&#xe607;</i> 微信：<?php echo $kf_wx;?></li><?php }?>
            <?php if (!empty($kf_email)){?><li><i class="ico" style="background-color:#c7c0de">&#xe641;</i> 邮箱：<?php echo $kf_email;?></li><?php }?>
            <?php if (!empty($kf_address)){?><li><i class="ico B" style="background-color:#cccdb8">&#xe61f;</i> 地址：<?php echo $kf_address;?></li><?php }?>
            <?php if (!empty($kf_qq)){?><li><i class="ico" style="background-color:#51B7EC">&#xe623;</i> QQ：<?php echo $kf_qq;if(!empty($kf_qq)){?><?php }?></li><?php }?>
            <div class="clear"></div>
        </div>
    <?php }?>
</div>
<?php
if (is_weixin()){
	require_once ZEAI."api/weixin/jssdk.php";?>
    <script src="<?php echo RES;?>jweixin-1.2.0.js"></script>
	<script>
	wx.config({debug:false,
		appId: '<?php echo $signPackage["appId"];?>',
		timestamp: <?php echo $signPackage["timestamp"];?>,
		nonceStr: '<?php echo $signPackage["nonceStr"];?>',
		signature: '<?php echo $signPackage["signature"];?>',
		jsApiList: ['hideMenuItems','onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','onMenuShareWeibo']
	});
	var share_article_detail_title = '<?php echo $shareT; ?>',
	share_article_detail_desc  = '<?php echo $shareC; ?>',
	share_article_detail_link  = '<?php echo $share_url;?>',
	share_article_detail_imgurl= '<?php echo $shareP; ?>';
	wx.ready(function () {
		wx.onMenuShareAppMessage({title:share_article_detail_title,desc:share_article_detail_desc,link:share_article_detail_link,imgUrl:share_article_detail_imgurl});
		wx.onMenuShareTimeline({title:share_article_detail_title,link:share_article_detail_link,imgUrl:share_article_detail_imgurl});
	});
	</script>
<?php }?>
<?php require_once ZEAI.'m/TRnav.php';
require_once ZEAI.'m/footer.php';?>
</body>
</html>